-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Axis category ordering - adds feature #189 #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axis category ordering - adds feature #189 #419
Conversation
categorymode: { | ||
valType: 'enumerated', | ||
values: [ | ||
'trace', 'category ascending', 'category descending', 'array' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should include truncated versions of those values as well e.g. 'cat asc'
, 'cat des'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest avoiding muti-word strings. Maybe just ascending
and descending
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me just ascending
`descendingdoesn't have a clear relation to _alpha_numeric ordering. I definitely understand the aversion to multi-word strings, but I would vote for more description than
ascending\
descending`
plus if 'value ascending'
\ 'value descending'
are going to be implemented eventually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I gotta say, catergoryorder
doesn't sound bad at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add them as labels to the axes (currently described as ticktext
) or use them as data (currently described as x
). Given that the axis.type
is category
, one might think that categories
is how you would add data to that axis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add them as labels to the axes
More like: categories are added automatically. Categories have no effect on ticktext
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the axis.type is category, one might think that categories is how you would add data to that axis.
Great point 👍
That's why I'm thinking that categoryorder
might be the winner here.
@monfera we should also add one |
👍 all good for me |
@monfera Awesome work. 🍻 |
Can someone provide an example (or point me to one) on how to use categoryorder = 'array' and categoryarray in order to manually specify the ordering of a categorical feature for plotting purposes with plotly? I can't find any online and all of my attempts in R have not worked. Any help would be appreciated |
@bmcole I suppose you looked into the examples in the PR, but on the off chance not yet, just search for 'test' here, below the images: https://github.com/plotly/plotly.js/pull/419/files |
I found the test examples with json code, but am still unsure of how to
"Tuesday","Wednesday","Thursday", "Friday", "Saturday"))
layout(xaxis=xform, yaxis=yform) On Mon, Jun 13, 2016 at 5:28 PM, Robert Monfera [email protected]
|
@bmcole I wonder if it's a date type related mismatch. Have you had any success with simple (non-date) strings or e.g. integer values? I don't have R in front of me right now but it may be a thing to try. |
@bmcole |
CR: #189
Original PR within downstream repo, with comments and historical commits: monfera#1
Implement axis attributes
categorymode
andcategorylist
to allow control of axis tick ordering independent of the trace order. See the attribute documentation, added Jasmine test cases and image tests for the API addition.